﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Word.Editor.Doc
{
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgFcLcb97
    {
        //length = 744 bytes        
        public UInt32 fcStshfOrig; 
        public UInt32 lcbStshfOrig;
        public UInt32 fcStshf;
        public UInt32 lcbStshf;
        public UInt32 fcPlcffndRef;
        public UInt32 lcbPlcffndRef;
        public UInt32 fcPlcffndTxt;
        public UInt32 lcbPlcffndTxt;
        public UInt32 fcPlcfandRef;
        public UInt32 lcbPlcfandRef;
        public UInt32 fcPlcfandTxt;
        public UInt32 lcbPlcfandTxt;
        public UInt32 fcPlcfSed;
        public UInt32 lcbPlcfSed;
        public UInt32 fcPlcPad;
        public UInt32 lcbPlcPad;
        public UInt32 fcPlcfPhe;
        public UInt32 lcbPlcfPhe;
        public UInt32 fcSttbfGlsy;
        public UInt32 lcbSttbfGlsy;
        public UInt32 fcPlcfGlsy;
        public UInt32 lcbPlcfGlsy;
        public UInt32 fcPlcfHdd;
        public UInt32 lcbPlcfHdd;
        /// <summary>
        /// An unsigned integer that specifies an offset in the Table Stream. 
        /// A PlcBteChpx begins at the offset. 
        /// fcPlcfBteChpx MUST be greater than zero, and MUST be a valid offset in the Table Stream.
        /// </summary>
        public UInt32 fcPlcfBteChpx;
        /// <summary>
        /// An unsigned integer that specifies the size, in bytes, of the PlcBteChpx at offset fcPlcfBteChpx in the Table Stream. 
        /// lcbPlcfBteChpx MUST be greater than zero.
        /// </summary>
        public UInt32 lcbPlcfBteChpx;
        /// <summary>
        /// An unsigned integer that specifies an offset in the Table Stream. 
        /// A PlcBtePapx begins at the offset. 
        /// fcPlcfBtePapx MUST be greater than zero, and MUST be a valid offset in the Table Stream.
        /// </summary>
        public UInt32 fcPlcfBtePapx;
        /// <summary>
        /// An unsigned integer that specifies the size, in bytes, of the PlcBtePapx at offset fcPlcfBtePapx in the Table Stream. 
        /// lcbPlcfBteChpx MUST be greater than zero.
        /// </summary>
        public UInt32 lcbPlcfBtePapx;
        public UInt32 fcPlcfSea;
        public UInt32 lcbPlcfSea;
        public UInt32 fcSttbfFfn;
        public UInt32 lcbSttbfFfn;
        public UInt32 fcPlcfFldMom;
        public UInt32 lcbPlcfFldMom;
        public UInt32 fcPlcfFldHdr;
        public UInt32 lcbPlcfFldHdr;
        public UInt32 fcPlcfFldFtn;
        public UInt32 lcbPlcfFldFtn;
        public UInt32 fcPlcfFldAtn;
        public UInt32 lcbPlcfFldAtn;
        public UInt32 fcPlcfFldMcr;
        public UInt32 lcbPlcfFldMcr;
        public UInt32 fcSttbfBkmk;
        public UInt32 lcbSttbfBkmk;
        public UInt32 fcPlcfBkf;
        public UInt32 lcbPlcfBkf;
        public UInt32 fcPlcfBkl;
        public UInt32 lcbPlcfBkl;
        public UInt32 fcCmds;
        public UInt32 lcbCmds;
        public UInt32 fcUnused1;
        public UInt32 lcbUnused1;
        public UInt32 fcSttbfMcr;
        public UInt32 lcbSttbfMcr;
        public UInt32 fcPrDrvr;
        public UInt32 lcbPrDrvr;
        public UInt32 fcPrEnvPort;
        public UInt32 lcbPrEnvPort;
        public UInt32 fcPrEnvLand;
        public UInt32 lcbPrEnvLand;
        public UInt32 fcWss;
        public UInt32 lcbWss;
        public UInt32 fcDop;
        public UInt32 lcbDop;
        public UInt32 fcSttbfAssoc;
        public UInt32 lcbSttbfAssoc;
        /// <summary>
        /// An unsigned integer that specifies an offset in the Table Stream. 
        /// A Clx begins at this offset.
        /// </summary>
        public UInt32 fcClx;
        /// <summary>
        /// An unsigned integer that specifies the size, in bytes, of the Clx at offset fcClx in the Table Stream. 
        /// This value MUST be greater than zero.
        /// </summary>
        public UInt32 lcbClx;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 472)]
        public byte[] Reserved2;

    }

    /// <summary>
    /// The FibRgFcLcb2000 structure is a variable-sized portion of the Fib. It extends the FibRgFcLcb97.
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgFcLcb2000 : FibRgFcLcb97
    {
        //public FibRgFcLcb97 rgFcLcb97;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 120)]
        public byte[] Reserved3;
    }

    /// <summary>
    /// The FibRgFcLcb2002 structure is a variable-sized portion of the Fib. It extends the FibRgFcLcb2000.
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgFcLcb2002 : FibRgFcLcb2000
    {
        //public FibRgFcLcb2000 rgFcLcb2000;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 224)]
        public byte[] Reserved4;
    }

    /// <summary>
    /// The FibRgFcLcb2003 structure is a variable-sized portion of the Fib. It extends the FibRgFcLcb2002.
    /// </summary>
    
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgFcLcb2003 : FibRgFcLcb2002
    {
        //public FibRgFcLcb2002 rgFcLcb2002;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 224)]
        public byte[] Reserved5;
    }
    /// <summary>
    /// The FibRgFcLcb2007 structure is a variable-sized portion of the Fib. It extends the FibRgFcLcb2003.
    /// </summary>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgFcLcb2007 : FibRgFcLcb2003
    {
        //public FibRgFcLcb2003 rgFcLcb2003;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 152)]
        public byte[] Reserved6;
    }


    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)]
    public class FibRgCswNewData2007 
    {
        /// <summary>
        /// An unsigned integer that specifies the number of times that this document was incrementally saved since the last full save. This value MUST be between 0 and 0x000F, inclusively.
        /// </summary>
        public UInt16 cQuickSavesNew;
        /// <summary>
        /// This value is undefined and MUST be ignored.
        /// </summary>
        public UInt16 lidThemeOther;
        /// <summary>
        /// This value is undefined and MUST be ignored.
        /// </summary>
        public UInt16 lidThemeFE;
        /// <summary>
        /// This value is undefined and MUST be ignored.
        /// </summary>
        public UInt16 lidThemeCS;
    }
        

}

